#include <stdio.h>
#define BUFFER_SIZE 1000


int f=0;
int vol=0;
char curveform[] =  "square               ";
char freq[] =  "square               ";
char volume[] =  "square               ";


main()
{
   FILE *fp;
   char buffer[BUFFER_SIZE];

   fp = fopen(".generator.conf", "r");

 while (fgets(buffer, sizeof buffer,fp) != NULL)
 {
   // process buffer
//   printf("READ: %s\n",buffer);
   sscanf(buffer," f %d",&f);
   sscanf(buffer," vol %d",&vol);
   sscanf(buffer," curveform %s",curveform);
 }
 if (feof(fp))
 {
   // hit end of file
   printf("end of story \n");
 }
 else
 {
   printf(" some other error interrupted the read\n");
 }

   fclose(fp);

   printf("Setting up generator \n");
   printf("frequency  %d \n  ",f);
   printf("volume %d  in  \% \n  ",vol);
   printf("curveform %s \n",curveform);
   





}
